//file: particle.h
//author: J.G.Yuan
//Date: 2006-8-28
//Desc:

#ifndef Particle_H_
#define Particle_H_

#include "Vect3.h"

typedef struct tagPosition
{
	float x;
	float y;
	float z;
}POSITION;

typedef struct tagColor
{
	float r;
	float g;
	float b;
}COLOR;

typedef struct tagVelocity
{
	float vx;
	float vy;
	float vz;
}VELOCITY;

typedef struct tagAcceleration
{
	float ax;
	float ay;
	float az;
}ACCELERATION;

class Particle	//class declaration
{
protected:
	POSITION pos;
	VELOCITY vel;
	ACCELERATION acc;
	COLOR col;
	float fAlpha;
	float fAlfdec;
	float fLife;
	bool bDead;
    unsigned int m_texture;


public:
	bool IsDead(){return bDead;}
	POSITION& GetPos(){return pos;}
	VELOCITY& GetVel(){return vel;}
	ACCELERATION& GetAcc(){return acc;}
	COLOR& GetCol(){return col;}
	float GetAlpha(){return fAlpha;}
	float GetLife(){return fLife;}
	
public:
	Particle();	//default constructor
	Particle(POSITION& inPos, 
		VELOCITY& inVel,
		ACCELERATION& inAcc,
		COLOR& inCol, 
        unsigned int inTexure,
		float inAlpha = 1.0f,
		float inAlfdec = 0.0f,
		float inLife = 1.0f,
		bool inDead = false);

	Particle(const Particle& p);	//copy constructor
	virtual ~Particle();	//destructor

	Particle& operator = (const Particle& p);

	//pure virtual function
	//so class Particle couldn't be realized
	virtual bool Render()=0;
	virtual void Update()=0;
};

#endif
